# -*- coding: utf-8 -*-

import re

class a:
    def __init__(self, env):
        environ = env
        self.forceHtml = False
        xmlMIMEs=['text/xml', 'application/xml']
        accept = filter(lambda x: x or False, map(lambda x: re.search(x, environ.get('HTTP_ACCEPT')) and x, xmlMIMEs))
        xmlType = (accept and accept[0]) or False
        self.ct = (self.forceHtml and 'text/html') or (xmlType or 'text/html')
        print self.ct


env = {'HTTP_ACCEPT':'tasext/xml applicaation/xml text/html'}
b = a(env)
